@import '../common.scss';

.navigation {
  z-index: 2;
  list-style: none;
  opacity: 0;
  display: none;
  margin: 0;
  padding: 5%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--color-main);
  position: fixed;
  top: 8%;
  right: 5%;
  transition: opacity 0.3s ease-in-out;
  font-weight: 200;

  @include from($large) {
    display: flex;
    opacity: 1;
    padding: 0;
    font-weight: 400;
    position: static;
    background: none;
    overflow: hidden;
    flex-direction: row;
  }

  &__wrapper {
    @include to($large) {
      .language-switcher {
        margin: 20px 0 0 0;
      }
    }

    @include from($large) {
      flex-grow: 100;
    }
  }
}

.navigation__language-picker {
  @include to($large) {
    margin-top: 10px;
  }
}

.navigation__icon-buttons {
  margin: 30px 0 0;

  @include from($large) {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin: 0 20px 0 0;
  }
}

.navigation__toggle {
  z-index: 3;
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 40px;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  border-radius: 4px;

  @include from($large) {
    display: none;
  }
}

.navigation__mobile-logo {
  display: none;
}

.navigation__toggle-icon {
  top: 8px;
  left: 10px;

  &,
  &:after,
  &::before {
    position: absolute;
    width: 30px;
    height: 3px;
    transition: all 0.3s ease;
    border-radius: 4px;
    background-color: var(--color-text);
  }

  &:before,
  &::after {
    content: '';
    display: block;
  }

  &::before {
    top: 10px;
  }
  &::after {
    top: 20px;
  }
}

@include to($large) {
  .is-open--navigation {
    overflow: hidden;
    height: 100vh;

    .navigation {
      opacity: 1;
      display: flex;
      align-items: flex-start;

      &::before {
        content: '';
        background-color: var(--color-main);
        position: absolute;
        width: 25px;
        height: 25px;
        top: -3px;
        right: 13px;
        transform: rotate(45deg);
      }
    }

    .navigation__mobile-logo {
      display: block;
      width: 30px;
      height: 30px;
      position: absolute;
      top: 47px;
      left: 5%;

      @include from($large) {
        display: none;
      }
    }

    .navigation__toggle-icon {
      transform: translate3d(0, 10px, 0) rotate(45deg);

      &,
      &::before,
      &::after {
        background: var(--color-text);
      }

      &::before {
        transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
        opacity: 0;
      }

      &:after {
        transform: translate3d(0, -19px, 0) rotate(-90deg);
      }
    }
  }
}

.navigation__item {
  margin: 10px 0;
  white-space: nowrap;

  &:first-of-type {
    margin: 0 0 10px;
  }

  &:last-of-type {
    margin: 10px 0 0;
  }

  @include from($large) {
    margin: 0 15px;
    padding: 0 !important;

    &:first-of-type {
      margin: 0 15px 0 2rem;
    }

    &:last-of-type {
      margin: 0 0 0 15px;
    }
  }
}
